import 'package:flutter/material.dart';
import "./type.dart";
import "./widget/HorizontalScrollCardWrap.dart";
import "./widget/DynamicVisitItemWidget.dart";
import "./widget/UpdateVideoItemWidget.dart";

// 动态_视频页
class DynamicVideo extends StatelessWidget {
  final List<DynamicVisitItem> dynamicVisitList = [
    DynamicVisitItem(
      avatar: './images/1.jpg',
      upName: '波士顿圆脸',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/2.jpg',
      upName: '噩梦D',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/3.jpg',
      upName: 'NBzhuo大',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/1.jpg',
      upName: '艾露露Allurus',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/2.jpg',
      upName: '央视农业',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/3.jpg',
      upName: '刘老师说电影',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/1.jpg',
      upName: '物华弥新',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/2.jpg',
      upName: '插画家斋藤直葵',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/3.jpg',
      upName: '哔哩哔哩会员购',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/1.jpg',
      upName: '开心嘴炮',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/2.jpg',
      upName: 'STN工作室',
      checked: false,
    ),
    DynamicVisitItem(
      avatar: './images/3.jpg',
      upName: '小满zs',
      checked: false,
    ),
  ];

  final List<UpdateVideoItem> updateVideoItem = [
    UpdateVideoItem(
      coverUrl: './images/1.jpg',
      title: '吹响吧！上低音号！',
      subTitle: '更新至第3话',
    ),
    UpdateVideoItem(
      coverUrl: './images/2.jpg',
      title: '香格里拉边境',
      subTitle: '更新至第23话',
    ),
    UpdateVideoItem(
      coverUrl: './images/3.jpg',
      title: '葬送的芙莉莲',
      subTitle: '全28话',
    ),
    UpdateVideoItem(
      coverUrl: './images/1.jpg',
      title: '擅长捉弄的高木同学',
      subTitle: '全12话',
    ),
    UpdateVideoItem(
      coverUrl: './images/2.jpg',
      title: '咒术回战 第二季',
      subTitle: '全23话',
    ),
  ];

  final List<DynamicItem> dynamicList = [
    // DynamicItem(
    //   upName: '噩梦D',
    //   avatar: './images/1.jpg',
    //   fansCardUrl: "./images/2.jpg",
    //   time: '1个小时前',
    //   isCooperate: false,
    //   type: 'video',
    //   videoTitle: '这就是近几年来最优秀的合家欢喜剧动画！？《间谍过家家带好:白》观影指南',
    //   content: '这就是近几年来最优秀的合家欢喜剧动画！？《间谍过家家带好:白》观影指南',
    //   videoCover: './images/3.jpg',
    //   shareCount: 0,
    //   commentCount: 92,
    //   likeCount: 846,
    //   isLike: false,
    //   videoDuration: '08:29',
    //   videoViewCount: '1.4万',
    //   videoDanmuCount: '101',
    // ),
    // DynamicItem(
    //   upName: '主厨农国栋',
    //   avatar: './images/1.jpg',
    //   time: '1个小时前',
    //   isCooperate: true,
    //   dynamicTopic: DynamicTopic(name: '春日出游美食'),
    //   dynamicLabelList: [
    //     DynamicLabel(name: '美食'),
    //     DynamicLabel(name: '美味'),
    //     DynamicLabel(name: '探店'),
    //   ],
    //   type: 'video',
    //   videoTitle: '青岛美食探店Ⅱ————遇到添加海鲜？希望大家心里有杆秤，不要被带节奏',
    //   videoCover: './images/3.jpg',
    //   shareCount: 0,
    //   commentCount: 92,
    //   likeCount: 846,
    //   isLike: false,
    //   videoDuration: '08:29',
    //   videoViewCount: '1.4万',
    //   videoDanmuCount: '101',
    // ),
  ];

  DynamicVideo({super.key});
  @override
  Widget build(BuildContext context) {
    return MediaQuery.removePadding(
      context: context,
      removeTop: true,
      child: ListView(
        children: [
          HorizontalScrollCardWrap(
            leading: const Text(
              '最常访问',
              style: TextStyle(
                fontWeight: FontWeight.bold,
                fontSize: 14,
              ),
            ),
            body: SizedBox(
              height: 90,
              width: double.infinity,
              child: ListView(
                scrollDirection: Axis.horizontal,
                children: dynamicVisitList.map((e) {
                  return DynamicVisitItemWidget(
                    avatar: e.avatar,
                    upName: e.upName,
                    checked: e.checked,
                  );
                }).toList(),
              ),
            ),
          ),
          const SizedBox(height: 10),
          HorizontalScrollCardWrap(
            leading: const Text(
              '我的追番·追剧',
              style: TextStyle(
                fontWeight: FontWeight.bold,
                fontSize: 14,
              ),
            ),
            trailing: const Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Text(
                  '全部',
                  style: TextStyle(
                    color: Colors.black54,
                    fontSize: 13,
                  ),
                ),
                Icon(
                  Icons.keyboard_arrow_right_outlined,
                  color: Colors.black54,
                  size: 18,
                )
              ],
            ),
            body: SizedBox(
              height: 100,
              width: double.infinity,
              child: ListView(
                scrollDirection: Axis.horizontal,
                children: updateVideoItem.map((e) {
                  return UpdateVideoItemWidget(
                    coverUrl: e.coverUrl,
                    title: e.title,
                    subTitle: e.subTitle,
                  );
                }).toList(),
              ),
            ),
          ),
          const SizedBox(height: 10),
          ...dynamicList.map((e) {
            return Text('列表');
          }).toList(),
          const SizedBox(height: 80)
        ],
      ),
    );
  }
}
